<template>
  <div>
    <common-form :formLabel="formLabelList" :form="operateForm">
      <el-button type="primary" @click="onsubmit">提交</el-button>
    </common-form>
  </div>
</template>

<script>
import CommonForm from "@/components/CommonForm";

export default {
  components: {CommonForm},
  data() {
    return {
      formLabelList: [
        {
          model: 'name',
          label: '姓名',
          type: 'input'
        },
        {
          model: 'age',
          label: '年龄',
          type: 'input'
        },
        {
          model: 'sex',
          label: '性别',
          type: 'select',
          opts: [
            {
              label: '男',
              value: 1
            },
            {
              label: '女',
              value: 0
            }
          ]
        },
        {
          model: 'birth',
          label: '出生日期',
          type: 'date'
        },
        {
          model: 'addr',
          label: '地址',
          type: 'input'
        }
      ],
      operateForm: {
        name: "",
        addr: "",
        age: "",
        birth: "",
        sex: "",
      },
    }
  },
  methods:{
    onsubmit(){

      console.log("onsubmit",this.operateForm)
    }
  }
}
</script>
